﻿package blizzard.fx{	import flash.display.MovieClip;	import flash.events.TimerEvent;	import flash.geom.Point;	import flash.utils.Timer;		import flyte.sound.SoundManager;
	public class Splash extends flash.display.MovieClip	{		public function Splash(p:Point,s:Number,playSound:Boolean,down:Boolean=true)		{			this.alpha = 0.5			this.x = p.x			this.scaleX = this.scaleY = s			this.y = p.y - (10 * s)						if(playSound) SoundManager.playSound( down? Splash1 : Splash2 )							this.gotoAndStop(1)			var invalidate:Boolean = false			var t:Timer = new Timer(s * 30)			var self:Splash = this			t.addEventListener(TimerEvent.TIMER,function(e:TimerEvent):void			{				if(invalidate)				{					t.stop()					visible = false					parent.removeChild(self)				}				nextFrame()				if(currentFrame == totalFrames)				{					invalidate = true				}			})			t.start()		}	}}